<%@ Page Language="C#" MasterPageFile="~/Admin/PMAdmin.Master" AutoEventWireup="true"
    CodeBehind="UsersForm.aspx.cs" Inherits="PM.Site.Admin.UsersForm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="form_left" >
        <div>
            <asp:Label ID="lblMsg" runat="server" Text="" Visible="false"></asp:Label>
        </div>
        <div style="float: left; width: 630px;">
            <asp:Panel ID="pnlOverviewUsers" runat="server" Font-Size="Medium" GroupingText="Overview User Accounts">
                <div style="padding: 5px;">
                    <asp:DataList ID="dlUserAccounts" DataKeyField="UserName" runat="server" Visible="true"
                        RepeatDirection="Horizontal" CellPadding="0" CellSpacing="0" HeaderStyle-Width="602px"
                        Font-Size="Small" ItemStyle-BackColor="#F6F4F5" ItemStyle-BorderColor="#6B6B6B"
                        ItemStyle-BorderWidth="1px" HeaderStyle-BackColor="#444444" HeaderStyle-Height="30px"
                        RepeatColumns="1" RepeatLayout="Flow" OnItemCommand="dlUserAccounts_ItemCommand">
                        <AlternatingItemStyle BackColor="#F9F9F9" />
                        <HeaderTemplate>
                            <div style="padding-bottom: 0px; height: 30px; margin: 0px; color: White;">
                                <div style="width: 170px; float: left; text-align: center; font-weight: bold; padding-left: 2px;">
                                    User Name</div>
                                <div style="width: 100px; float: left; text-align: center; font-weight: bold;">
                                    User Type</div>
                                <div style="width: 180px; float: left; text-align: center; font-weight: bold;">
                                    Client Id</div>
                                <div style="width: 50px; float: left; text-align: center; font-weight: bold;">
                                    Active</div>
                                <div style="width: 60px; float: left; text-align: center; font-weight: bold;">
                                    Delete</div>
                            </div>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <div style="float: left; margin-bottom: 0px; width: 600px; min-height: 15px; font-size: small;">
                                <div style="width: 170px; float: left; text-align: left; min-height: 12px; padding-left: 2px;">
                                    <label>
                                        <%# Eval("UserName")%></label></div>
                                <div style="width: 100px; float: left; text-align: center; min-height: 12px;">
                                    <label>
                                        <%# Eval("UserTypeId")%></label></div>
                                <div style="width: 180px; float: left; text-align: left; min-height: 12px;">
                                    <label>
                                        <%# Eval("ClientId")%></label></div>
                                <div style="width: 50px; float: left; text-align: left; font-weight: bold;">
                                    <asp:CheckBox ID="chkActive" Checked='<%#Eval("Active") %>' runat="server" /></div>
                                <div style="width: 60px; text-align: center; vertical-align: top; float: left;">
                                    <asp:ImageButton ID="imgDelete" CommandName="DeleteUserAccount" CommandArgument='<%# Eval("UserName")%>'
                                        ImageUrl="~/Images/Delete.gif" runat="server" Visible='<%# !(bool)Eval("Active") %>'
                                        AlternateText="delete user" OnClientClick="return confirm('Are you sure you want to delete this user account?')" />
                                </div>
                            </div>
                        </ItemTemplate>
                    </asp:DataList>
                </div>
                <br />
                <div style="float: right;">
                    <asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" />
                </div>
            </asp:Panel>
        </div>
        <div style="float: left; margin-left: 10px;">
            <asp:Panel ID="pnlAddUser" runat="server" GroupingText="Add New User" Font-Size="Medium">
                <table style="font-size: smaller;" id="div_left">
                    <tr>
                        <td style="width: 100px">
                            User Name
                        </td>
                        <td>
                            :
                            <asp:TextBox ID="txbUserName" runat="server" TextMode="SingleLine"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Password
                        </td>
                        <td>
                            :
                            <asp:TextBox ID="txbPassword" runat="server" TextMode="Password"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            User Type
                        </td>
                        <td>
                            :
                            <asp:DropDownList ID="ddlUserTypes" runat="server" DataTextField="Description" DataValueField="TypeId"
                                Width="125">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Client Id
                        </td>
                        <td>
                            :
                            <asp:DropDownList ID="ddlClientIds" runat="server" DataTextField="Other_Names" DataValueField="ClientId">
                            <asp:ListItem Text="~" Value="" Selected="True"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Active
                        </td>
                        <td>
                            :
                            <asp:CheckBox ID="chkbActive" runat="server" Checked="true" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
